package com.anolesoft.yr.mbus.prod.pack.mapper;

import com.anolesoft.yr.mbus.prod.pack.dto.ProdPackageServiceDeleteDTO;
import com.anolesoft.yr.mbus.prod.pack.dto.ProdPackageServiceValueSaveDTO;
import com.anolesoft.yr.mbus.prod.pack.dto.ProdPackageServiceValueUpdateDTO;
import com.anolesoft.yr.mbus.prod.pack.sql.ProdPackageServiceValueSQL;
import com.anolesoft.yr.mbus.prod.pack.vo.ProdPackageServiceValueQueryVO;
import org.apache.ibatis.annotations.*;

import java.util.List;

@Mapper
public interface ProdPackageServiceValueMapper {

    //新增产品套餐服务项参数信息表
    @Insert(ProdPackageServiceValueSQL.SAVE_PROD_PACKAGE_SERVICE_VALUE)
    int saveProdPackageServiceValue(ProdPackageServiceValueSaveDTO prodPackageServiceValueSaveDTO);

    //修改产品套餐服务项参数信息表
    @Update(ProdPackageServiceValueSQL.UPDATE_PROD_PACKAGE_SERVICE_VALUE)
    int updateProdPackageServiceValue(ProdPackageServiceValueUpdateDTO ProdPackageServiceValueUpdateDTO);

    //删除产品套餐服务项参数信息表
    @Delete(ProdPackageServiceValueSQL.DELETE_PROD_PACKAGE_SERVICE_VALUE)
    int deleteProdPackageServiceValue(@Param("prodPackageUid") String prodPackageUid, @Param( "prodPackageServiceDeleteDTOList" ) List<ProdPackageServiceDeleteDTO> prodPackageServiceDeleteDTOList);

    //根据主键查询产品套餐服务项参数唯一数据
    @Select(ProdPackageServiceValueSQL.QUERY_PROD_PACKAGE_SERVICE_VALUE_BY_UID)
    @Results(id = "queryProdPackageServiceValueByUid", value = {
            @Result(column = "objuid", property = "objuid"),
            @Result(column = "prod_package_serviceUid", property = "prodPackageServiceUid"),
            @Result(column = "prod_service_value_uid", property = "prodServiceValueUid"),
            @Result(column = "value", property = "value"),
            @Result(column = "is_default", property = "isDefault"),
            @Result(column = "is_holiday", property = "isHoliday"),
            @Result(column = "accept_time", property = "acceptTime"),
            @Result(column = "reply_time", property = "replyTime"),
            @Result(column = "delivery_time", property = "deliveryTime"),
            @Result(column = "arrival_time", property = "arrivalTime")
    })
    List<ProdPackageServiceValueQueryVO> queryProdPackageServiceValueByUid(@Param("objuid") String objuid, @Param("prodPackageServiceUid") String prodPackageServiceUid);

}
